package guava;

import com.google.common.collect.ImmutableList;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Demo01 {
    public static void main(String[] args) throws SQLException {
        List<String> list = new ArrayList<>();
        list.add("a");
        list.add("b");
        list.add("c");
        System.out.println("list = " + list);
        List<String> unList = Collections.unmodifiableList(list);
        System.out.println("unList = " + unList);
        ImmutableList<String> immutableList = ImmutableList.copyOf(list);
        System.out.println("immutableList = " + immutableList);

        System.out.println("=====================");
        list.add("d");
        System.out.println("unList = " + unList);
        System.out.println("immutableList = " + immutableList);
    }
}
